package com.yswy.common.enums;

import com.yswy.common.enums.base.EnumHelper;
import com.yswy.common.enums.base.TypeEnum;
import com.yswy.common.enums.base.TypeEnumDto;

import java.util.List;
import java.util.Map;

public enum TriggerNodeEnums implements TypeEnum {

    LOGIN(0, "登录"),
    PAY(1, "付费"),
    AGREEMENT(2, "签约"),
//    ADECPM(3, "广告ECPM"),
    ;
    TriggerNodeEnums(int code, String message) {
        this.code = code;
        this.message = message;
    }

    private final int code;

    private final String message;

    public int getCode() {
        return this.code;
    }

    public String getMessage() {
        return this.message;
    }

    public static List<TypeEnumDto> kv = EnumHelper.getTypeEnum(values());

    // 根据描述获取枚举值
    public static TriggerNodeEnums getByDesc(String desc) {
        for (TriggerNodeEnums jlyq : TriggerNodeEnums.values()) {
            if (jlyq.getMessage().equals(desc)) {
                return jlyq;
            }
        }
        return null; // 或者抛出一个异常，如果你确定输入是有效的
    }

    public static void main(String[] args) {
        TriggerNodeEnums tfPlatformEnums = getByDesc("巨量引擎");
        String tfPlatform = tfPlatformEnums.toString();
        System.out.println(tfPlatform);
    }
}
